<script type="text/javascript" src='{$base_dir}modules/dept_laboratory/js/AJAX_LabAssignment.js'></script>
{literal}
<script>
$(document).ready(function(){
    
    addDatePickerTime("#labAssignment_dd",'#labAssignment_mm','#labAssignment_yyyy','#labAssignmentTime',false,false,true);

    $('#labAssignmentGroup').bind('change',function(){      
            var labGroupId = $('#labAssignmentGroup :selected').val();
            if (labGroupId != null && $.trim(labGroupId) != '') {
                loadLabServicesOfSelectedGroup({/literal}{$ticketId}{literal}, labGroupId);                
            }        
    });
    
    $('#selectServices').bind('click',function(){  
        selectLabServices();                
    });
    $('#unSelectServices').bind('click',function(){  
        unSelectServicesFromList();                
    });

    var buttons = {};
    
    
	buttons[_('Cancel')] = function() {
	    $(this).dialog('close');        
	};
	
	buttons[_('Create and Print')] = function() {
	   	createLabAssignment({/literal}{$ticketId}{literal},'{/literal}{$idOfActionAfterCreating}{literal}', $(this), true);        	
	};
	
	buttons[_('Create')] = function() {
	   	createLabAssignment({/literal}{$ticketId}{literal},'{/literal}{$idOfActionAfterCreating}{literal}', $(this), false);
	
	};
	generalDialog('labConnectorAssignment1111',_("Laboratory assignment"),null,null,{
	        autoOpen: true,         
	        bgiframe: true,
	        resizable: false,
	        modal: true,
	        width:900,
	        height:480,
	        buttons: buttons
	    });  
})
</script>
{/literal}
<div id="labConnectorAssignment1111">
	<div id="labAssignmentTop" style='margin-bottom: 10px;'>
		<span id="labAssignmentStatusMessage"></span>
		<table cellspacing='0' cellpadding='0' class="grid" style='width: 870px'>
			<tr>
				<th style='width: 30%'>{translate}Doctor{/translate}</th>
				<th style='width: 30%'>{translate}Requested time{/translate}</th>
				<th style='width: 40%'>{translate}Diagnosis{/translate}</th>
			</tr>
			<tr class='last'>
				<td class='form_input' valign='top'>
					<select style="width: 100%" id="labAssignmentDoctorName">
						<option id="empty" value="0">{translate}Select doctor{/translate}</option>
						{html_options options=$doctorList}
					</select>
				</td>
				<td class='form_input' valign='top'>
					<input onkeypress="return allowEnterIntegerNum(event,true)" name="labAssignment_{$datePart_0}" id="labAssignment_{$datePart_0}" type="text" value="" style="width: 30px;">
					<input onkeypress="return allowEnterIntegerNum(event,true)"	name="labAssignment_{$datePart_1}" id="labAssignment_{$datePart_1}" type="text" value="" style="width: 30px;">
					<input onkeypress="return allowEnterIntegerNum(event,true)" name="labAssignment_{$datePart_2}" id="labAssignment_{$datePart_2}" type="text" value="" style="width: 56px;">
					<input name="labAssignmentTime" type="text" id="labAssignmentTime" style="width: 56px;">
					<br /><span class="label" style="width: 21px; color: #AAA;">({$datePart_0}-{$datePart_1}-{$datePart_2} hh:mi)</span>
				</td>
				<td class='form_input' valign='top'>
					<textarea style="width: 100%;" id="labAssignmentDiagnosis"></textarea>
				</td>
			</tr>
		</table>
	</div>
	
	<div>
		<table cellspacing='0' cellpadding='0' class="grid" style='width: 870px'>
			<tr>
				<th style="width: 20%">{translate}Lab group{/translate}</th>
				<th style="width: 38%">{translate}Lab service detail{/translate}</th>
				<th style="width: 4%">&nbsp;</th>
				<th style="width: 38%"><span id="labAssignmentTotalPrice">{translate}Assigned services [Price:%s]{/translate}</span></th>
			</tr>
			<tr class='last'>
				<td class='form_input'>
					<select style="width: 100%" id="labAssignmentGroup" size="15" >
		            	{html_options options=$labAssignmentModel}            
		            </select>
				</td>
				<td class='form_input'>
					<select style="width: 100%" id="labAssignmentServiceDetail" size="15" multiple="multiple" groupid='0'>
					</select>
		        </td>
		        <td class='form_input'>
		        	<input id="selectServices" style="width: 25px;" type="button" value="&gt;&gt;">
		            <br/><br/>
		        	<input id="unSelectServices" style="width: 25px;" type="button" value="&lt;&lt;">
		        </td>
		        <td class='form_input'>
		        	<select style="width: 100%" id="labAssignmentAssignedServices" size="15" multiple="multiple">
		        	</select>
		        </td>
			</tr>
		</table>
	</div>							
</div>